/**
 * 键值对 下拉菜单
 * @param nowSelectId
 * @param url
 * chenliang
 */
function kvComboBox(nowSelectId, url){
	$(nowSelectId).combobox({
		url: url,
		panelHeight: '120',
		valueField:'code',
		textField:'name',
		filter: function(q, row){
		    var opts = $(this).combobox('options');
		    var r = false ;
		    if(row['code']){
		    	r = row[opts.textField].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q.toUpperCase()) >= 0;
		    }else{
		    	r = row[opts.texbxtField].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q) >= 0 ;
		    }
		    return r;
		},
		onSelect: function(rec){
		}
	});
}
function kvComboBoxLoadData(nowSelectId, loadData){
	$(nowSelectId).combobox({
//		url: url,
		panelHeight: '120',
		valueField:'code',
		textField:'name',
		filter: function(q, row){
		    var opts = $(this).combobox('options');
		    var r = false ;
		    if(row['code']){
		    	r = row[opts.textField].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q.toUpperCase()) >= 0;
		    }else{
		    	r = row[opts.texbxtField].indexOf(q) >= 0 || 
		    		row['code'].indexOf(q) >= 0 ;
		    }
		    return r;
		},
		onSelect: function(rec){
		}
	});
	$(nowSelectId).combobox("loadData", loadData);
}
